package com.boot.main.mapper;

import com.boot.main.entity.BcomArticle;
import com.boot.main.entity.BcomTag;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Mapper
@Repository
public interface BcomArticleMapper {
    List<BcomArticle> getArticles(@Param("currentSize") Integer currentSize, @Param("limit") Integer limit, @Param("title") String title, @Param("cid") Long cid);
    List<BcomArticle> getBlogArticles(@Param("currentSize") Integer currentSize, @Param("limit") Integer limit, @Param("title") String title, @Param("cid") Long cid, @Param("tag") String tag);
    List<BcomTag> getTags();
    BcomArticle getArticleById(@Param("id") Long id);
    Integer getTotalCount(@Param("title") String title, @Param("cid") Long cid);
    Integer saveArticle(BcomArticle article);
    Integer updateArticle(BcomArticle article);
    Integer updateArticleView(@Param("view") Integer view, @Param("id") Long id);
    Integer deleteArticle(@Param("id") Long id);
}
